package com.sg.dto.integration.calc;

import com.sg.common.dto.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;

/**
 * @desc AverageOfMultipleNumDto
 * @使用场景
 */
@Data
public class AverageOfMultipleNumDto extends BaseDto implements Serializable {

    /**
     * 数据结果ID
     */
    @NotNull(message = "数据结果ID 不能为空")
    @ApiModelProperty("数据结果ID ")
    private String dataResultId;

    /**
     * 数据值结果
     */
    @NotNull(message = "数据值结果不能为空")
    @ApiModelProperty("数据值结果")
    private Double dataResult;

    /**
     * 归属内容表主键ID
     */
    @NotNull(message = "归属内容表主键ID不能为空")
    @ApiModelProperty("归属内容表主键ID")
    private String entityId;

    /**
     * 通用主键ID
     */
    @ApiModelProperty("通用主键ID")
    private String commPrimaryKey;

    /**
     * 通用数值字段
     */
    @ApiModelProperty("通用数值字段")
    private Long comNumField;

    /**
     * 计算入参1
     */
    @ApiModelProperty("计算入参1")
    private Double calcPara1;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        AverageOfMultipleNumDto that = (AverageOfMultipleNumDto) o;
        return (
                dataResultId == that.dataResultId &&
                        dataResult == that.dataResult &&
                        entityId == that.entityId &&
                        commPrimaryKey == that.commPrimaryKey &&
                        comNumField == that.comNumField &&
                        calcPara1 == that.calcPara1
        );
    }

    @Override
    public int hashCode() {
        return Objects.hash(
                super.hashCode(),
                dataResultId,
                dataResult,
                entityId,
                commPrimaryKey,
                comNumField,
                calcPara1
        );
    }

}
